home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Sunday Times: The Month 2003 December
/
The Sunday Times - The Month 2003-12.iso
/
mac
/
The Month DEC 03
/
engine
/
modules
/
preview_widenofade.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2003-09-05
|
6KB
|
231 lines
function addLink(mc)
{
Links[mc.link] = mc;
}
function getMCfromLink(Item)
{
if(Links[Item] == null)
{
var arr = [];
while(Item != sideMenu.ItemHome)
{
arr.unshift(Item._name.split("_").pop());
Item = Item._parent._parent;
}
var str = arr.join("/");
Links[Item] = Links[str];
}
return Links[Item];
}
function removeLinkListener()
{
Tardis.sideMenu.EB.removeListener(this);
}
function init()
{
var strID = Tardis.ActiveSection.id;
var Colors = Tardis.Colors;
strSECTION_COLOR = Colors.getString(strID);
hxSECTION_COLOR = Colors.getHex(strID);
strSECTION_COLOR50 = Colors.getString(strID + "50");
hxSECTION_COLOR50 = Colors.getHex(strID + "50");
hxDEFAULT_COLOR = Colors.getHex("default");
strDEFAULT_COLOR50 = Colors.getString("default50");
ndItems = nodeData.byName("items");
ndDefault = nodeData.byName("default");
loadFader();
_visible = true;
doOut();
}
function loadFader()
{
this.createEmptyMovieClip("mc_images",++depth);
mc_images.onReady = function()
{
this.onComplete = function()
{
delete this.onComplete;
this._parent.onComplete();
};
this.nodeData = this._parent.ndItems;
this.strPathPrefix = this._parent.strPathPrefix;
this.init();
};
mc_images.loadMovie(strPathPrefix + Tardis.ASSETS_FOLDER + "modules/preview_nofade/preview_nofade.swf");
}
function clearFader()
{
removeMovieClip("mc_images");
loadFader();
mc_images.clearUp();
}
function exit()
{
delete ndItems;
delete ndDefault;
delete nodeData;
}
function doOver(num)
{
if(num != 0)
{
var node = ndItems.childNodes[num];
populateRollText(node);
mc_images.doOver(num);
}
}
function doOut(num)
{
populateRollText(ndDefault);
mc_images.doOut(nodeData.childNodes.length);
}
function doPromoOver()
{
promoOver(true);
}
function doPromoOut()
{
promoOut(true);
}
function promoUp()
{
Tardis.sideMenu.doPromoUp();
}
function promoOver(fromSideMenu)
{
promoMC.gotoAndStop("on");
if(fromSideMenu == null)
{
Tardis.sideMenu.doPromoOver();
}
}
function promoOut()
{
promoMC.gotoAndStop("off");
if(fromSideMenu == null)
{
Tardis.sideMenu.doPromoOut();
}
}
function txtOver(mc)
{
Tardis.sideMenu.doOver(mc.link);
}
function txtOut(mc)
{
Tardis.sideMenu.doOut(mc.link);
}
function txtUp(mc)
{
if(mc.navLink)
{
Tardis.sideMenu.doUp(mc.link);
}
else
{
Tardis.webPageOpen(mc.link,"_blank");
}
}
function populateRollText(node)
{
var promo = false;
removeMovieClip("promoMC");
titleFF.htmlText = "";
title2FF.htmlText = "";
bodyFF.htmlText = "";
TEXT_POS = 6;
var strTitle = node.byName("title").getText();
var strTitle2 = node.byName("title2").getText();
var strTitle3 = node.byName("title3").getText();
if(strTitle != null || strTitle2 != null || strTitle3 != null)
{
var strTitleTxt = "<FONT COLOR=\"" + strSECTION_COLOR + "\">" + strTitle + " </FONT>";
strTitleTxt += "<FONT COLOR=\"" + strSECTION_COLOR50 + "\"> " + strTitle2 + " </FONT>";
strTitleTxt += "<FONT COLOR=\"" + strDEFAULT_COLOR50 + "\"> " + strTitle3 + " </FONT>";
titleFF.htmlText = strTitleTxt;
titleFF._y = TEXT_POS;
titleFF.resize();
TEXT_POS += titleFF._height - 3;
}
var strByline = node.byName("byline").getText();
if(strByline != null)
{
title2FF.htmlText = strByline;
title2FF.textColor = hxDEFAULT_COLOR;
title2FF._y = TEXT_POS;
title2FF.resize();
TEXT_POS += title2FF._height - 9;
}
var strBody = node.byName("body").getText();
if(strBody != null)
{
bodyFF.htmlText = strBody;
bodyFF.textColor = hxDEFAULT_COLOR;
bodyFF._y = TEXT_POS;
}
var ndPromo = node.byName("promotion");
if(ndPromo.byName("byline2").getText() != null)
{
attachMovie("promoMC2","promoMC",++depth);
promoMC._x = 287;
promoMC._y = 157;
promo = true;
}
else if(ndPromo.byName("title").getText() != null || ndPromo.byName("byline").getText() != null)
{
attachMovie("promoMC1","promoMC",++depth);
promoMC._x = 287;
promoMC._y = 173;
promo = true;
}
if(promo)
{
if(ndPromo.attributes.link != null)
{
PromoMC.link = ndPromo.attributes.link;
PromoMC.navLink = true;
}
else
{
PromoMC.link = ndPromo.byName("link").getText();
}
var fldPTitle = PromoMC.promotitleFF;
var fldPByLine = PromoMC.promobylineFF;
var fldPByLine2 = PromoMC.promobyline2FF;
fldPTitle.htmlText = ndPromo.byName("title").getText();
fldPTitle.textColor = hxSECTION_COLOR50;
fldPTitle.autosize = true;
fldPByLine._x = fldPTitle._x + fldPTitle._width;
fldPByLine.htmlText = ndPromo.byName("byline").getText();
fldPByLine.textColor = hxDEFAULT_COLOR;
fldPByLine.autosize = true;
var strByLine2 = ndPromo.byName("byline2").getText();
if(strByLine2 != null)
{
fldPByLine2.htmlText = strByLine2;
fldPByLine2.textColor = hxDEFAULT_COLOR;
}
else
{
PromoMC.promobyline2FF._height = 0;
}
PromoMC.btn._width = fldPByLine._width + fldPTitle._width;
PromoMC.btn._height = PromoMC._height + fldPByLine2._height;
}
else
{
PromoMC.btn.enabled = false;
}
}
Links = {};
Tardis.sideMenu.EB.addListener(this);
_visible = false;
_parent.preview = this;
depth = 0;
this.onUnload = function()
{
removeLinkListener();
this.onUnload = null;
};
var nmLastCover = -1;